package cn.icanci.loopstack.script.compile;

import groovy.lang.GroovyClassLoader;

/**
 * @author icanci
 * @since 1.0 Created in 2023/01/17 14:43
 */
public class GroovyClassLoaderHolder {
    private static final GroovyClassLoader GROOVY_CLASS_LOADER = new GroovyClassLoader();

    /**
     * 编译成Class文件
     * 
     * @param codeSource codeSource
     * @return 返回编译的Class文件
     */
    public static Class<?> compile(String codeSource) {
        return GROOVY_CLASS_LOADER.parseClass(codeSource);
    }
}
